﻿//视频播放

	
		
jQuery(function($){
	
	  var spurl = $(".info video").attr("src");
	  $(".info video").attr("width","285");
	  $(".info video").removeAttr("loop");
	  $(".info video").attr("tabindex","0");
	  $(".info video").attr("preload","auto");
	  $(".info video").attr("autoplay","autoplay");

	  var picurl = $(".info video").attr("poster");
	  $(".info video").css("background-image","url("+picurl+")");
	  $(".info video").css("background-origin","padding-box");
	  $(".info video").css("background-position","0 0");
	  $(".info video").css("background-repeat","no-repeat");
	  $(".info video").css("background-size","100%");
	  
	  
    $("#function_code_page").html('<div style="width: 320px; text-align: center; padding-top: 10px;">'+
		'<a href="'+spurl+'">'+
		'<img style="width: 120px;" src="../../../../images/zxbf.jpg"/></a> </div>');
		
	 $("video").attr("id","media");
 
		$("#media").after('<img onclick="bofang()"  class="imgbf" src="../../../../images/play.png" alt="" style="height: 50px;top:40%;left: 40%;position: absolute;width: 50px; display:none; " />');
		
	
		
		$(document).ready(function(){
   var userAgent=  navigator.userAgent.toLowerCase();
 
    if(userAgent.indexOf('mi-one')>=0){
    		 $(".info video").removeAttr("onclick");
    	}
    	else{
    			 if(userAgent.indexOf('android')>=0){
    			 			  $(".imgbf").css("display","block");
    			 	}
    		}
      var url = window.location.href;
    	if(url.indexOf('/iphone6/')>=0&&userAgent.indexOf('android')>=0){
    			 $(".imgbf").css("display","block");
    			 
    		}	
    	
})
 
    
	
	
	var	Media = document.getElementById("media");
	
		// var media = document.getElementById("videoplay");
		 
		
	  eventTester = function(e){  
    Media.addEventListener(e,function(){  
    	if(e =="play"){
          $(".imgbf").css("display","none");
        }
   
    });  
}  
		if(Media){ 
		 eventTester("play");  
		 }
		 
	
		
});

function bofang(){
	
		var	Media = document.getElementById("media");
		Media.play();
	}
